Skip to content

Remove most old example code#470

Open
PhilipFackler wants to merge 3 commits into
developfrom
PhilipFackler/example-tests
Open

Remove most old example code#470
PhilipFackler wants to merge 3 commits into
developfrom
PhilipFackler/example-tests

Conversation

@PhilipFackler

Copy link
Copy Markdown
Collaborator

Description

Remove example code that duplicates what the DynamicSimulation app does

Closes #390 (indirectly)

Proposed changes

  • Add existing "tiny" cases to CaseFormatTests to check JSON parser
  • Remove example source code
  • Create ref.csv files for cases that were still using the .hpp data
  • Create .solver.json files where needed
  • Update tests and input/output files to use same naming conventions

Checklist

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • [N/A] The new code follows GridKit™ style guidelines.
  • [N/A] There are unit tests for the new code.
  • [N/A] The new code is documented.
  • The feature branch is rebased with respect to the target branch.
  • [N/A] I have updated CHANGELOG.md to reflect the changes in this PR. If this is a minor PR that is part of a larger fix already included in the file, state so.

@PhilipFackler
PhilipFackler force-pushed the PhilipFackler/example-tests branch 2 times, most recently from 2c5dda5 to 08f2c6f Compare June 26, 2026 20:57
@pelesh
pelesh self-requested a review June 26, 2026 21:22
@nkoukpaizan
nkoukpaizan self-requested a review June 27, 2026 21:28

@pelesh pelesh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than removing examples, I would turn them into integration tests. Some of those examples set up GridKit apps without parser and thus verify that the system composer generates system models correctly and integrates well with solvers.

@PhilipFackler

Copy link
Copy Markdown
Collaborator Author

Rather than removing examples, I would turn them into integration tests. Some of those examples set up GridKit apps without parser and thus verify that the system composer generates system models correctly and integrates well with solvers.

I added them in CaseFormatTests to compare parsing results with the direct assignment that was in those examples. I thought this was what we had discussed before, but maybe I misunderstood. Do you want something more than that?

@PhilipFackler
PhilipFackler force-pushed the PhilipFackler/example-tests branch 4 times, most recently from 91f8a14 to 5b2e2fd Compare July 2, 2026 19:42
@PhilipFackler
PhilipFackler force-pushed the PhilipFackler/example-tests branch 3 times, most recently from e8a9eba to 4b7d081 Compare July 13, 2026 17:19
@PhilipFackler
PhilipFackler marked this pull request as ready for review July 13, 2026 18:56
@PhilipFackler
PhilipFackler requested a review from pelesh July 13, 2026 18:57
@lukelowry

Copy link
Copy Markdown
Collaborator

This would be nice to merge soon in preparation for the updated case data and documentation

@pelesh

pelesh commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Rather than removing examples, I would turn them into integration tests. Some of those examples set up GridKit apps without parser and thus verify that the system composer generates system models correctly and integrates well with solvers.

I added them in CaseFormatTests to compare parsing results with the direct assignment that was in those examples. I thought this was what we had discussed before, but maybe I misunderstood. Do you want something more than that?

I suggest we move examples that do not use parser to the integration tests directory. They have educational value as they show what happens under the hood and how the system is assembled.

CaseFormatTests fits better in unit tests. I would move it there.

@PhilipFackler
PhilipFackler force-pushed the PhilipFackler/example-tests branch from 4b7d081 to 5c474f5 Compare July 20, 2026 15:40
@PhilipFackler

Copy link
Copy Markdown
Collaborator Author

@nkoukpaizan, @pelesh this is ready to go

@PhilipFackler
PhilipFackler force-pushed the PhilipFackler/example-tests branch from 5c474f5 to 13cc873 Compare July 20, 2026 15:42

@nkoukpaizan nkoukpaizan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good to me. A couple of minor commnents.

I also noticed the ThreeBusZipLoadJson is missing an add_test and updated reference file implementation. @PhilipFackler Just so this is complete for TwoBus and ThreeBus examples, would you mind converting that example as well?

Comment thread application/PhasorDynamics/AnalysisUtilities.hpp Outdated
Comment thread application/PhasorDynamics/AnalysisUtilities.hpp Outdated
Comment thread examples/PhasorDynamics/Tiny/TwoBus/Basic/TwoBusBasicJson.cpp
],
"reference_file": "TwoBusBasic.ref.csv",
"error_tolerance": 2.03e-4
"error_tolerance": [2.01e-4, 1e-4]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good for compatibility with the current implementation. I would question the value keeping per-variable errors, especially since this does not scale to larger cases. cc @lukelowry @abirchfield

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concur

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It IS optional...and a little bit secret. :)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as it's optional, it certainly does not hurt to have. Bless you sir

PhilipFackler and others added 2 commits July 20, 2026 13:16
Co-authored-by: Nicholson Koukpaizan <72402802+nkoukpaizan@users.noreply.github.com>
@PhilipFackler
PhilipFackler force-pushed the PhilipFackler/example-tests branch from ac90307 to 86fa582 Compare July 20, 2026 19:01

@nkoukpaizan nkoukpaizan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I'll give others some time to review before merging.

@lukelowry lukelowry left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much needed cleanup thank you for doing this, quite appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: mon.csv write race causes flaky parallel ctest failures

4 participants